<?php

/**
 * Created by PhpStorm.
 * User: wukent
 * Date: 2017/9/21
 * Time: 上午11:17
 */
class MerchantPhotoModel extends Model
{
    public function getCount($id) {

        $where = array('merchant_id'=>$id);
        $data = $this
            ->where($where)
            ->order('photo_id DESC')
            ->count();
        return $data;
    }

    public function getList($id,$page=1,$pernum=6) {

        $where = array('merchant_id'=>$id);
        $data = $this
            ->where($where)
            ->order('photo_id DESC')
            ->page($page.','.$pernum)
            ->select();
        return $data;

    }

}